package phonecompany.account;

import java.rmi.Remote;

import phonecompany.call.Call;
import phonecompany.customer.Customer;
import phonecompany.phone.PhoneNumber;

/**
 * This is a interface to access all the kinds of accounts.also used to help
 * deploy the RMI appliocation.
 * 
 * @since Oct 24, 2011
 * @author <a href="mailto:zexpp5@gmail.com">Zexu.Lin</a>
 * @version $Id: Account.java 28 2011-10-30 21:25:58Z zexpp5@gmail.com $
 * 
 */
public interface Account extends Remote {
	/**
	 * To get the account's related phone number.
	 * 
	 * @return
	 * @description
	 * 
	 * @author <a href="mailto:zexpp5@gmail.com">Zexu.Lin</a>
	 * @update Oct 30, 2011 6:58:14 PM
	 */
	public abstract PhoneNumber getNumber();

	/**
	 * To get the account's related balance.
	 * 
	 * @return
	 * @description
	 * 
	 * @author <a href="mailto:zexpp5@gmail.com">Zexu.Lin</a>
	 * @update Oct 30, 2011 6:58:45 PM
	 */
	public abstract double getBalance();

	/**
	 * To generate a Call object and try to charge it when a phone of this
	 * account call some other phone.
	 * 
	 * @param toNumber
	 * @param duration
	 *            by minute.
	 * @return a call object contains fromPhoneNumber ,toPhoneNumber and the
	 *         duration time.
	 * @description
	 * 
	 * @author <a href="mailto:zexpp5@gmail.com">Zexu.Lin</a>
	 * @update Oct 30, 2011 6:59:05 PM
	 */
	public abstract Call chargeCall(PhoneNumber toNumber, int duration);

	/**
	 * To credit current Account.
	 * 
	 * @param pounds
	 * @return true:success,false:faild
	 * @description
	 * 
	 * @author <a href="mailto:zexpp5@gmail.com">Zexu.Lin</a>
	 * @update Oct 30, 2011 7:00:56 PM
	 */
	public abstract boolean creditAccount(double pounds);

	/**
	 * To get the related customer of the account.
	 * 
	 * @return customer occupied this account.
	 * @description
	 * 
	 * @author <a href="mailto:zexpp5@gmail.com">Zexu.Lin</a>
	 * @update Oct 30, 2011 7:01:36 PM
	 */
	public abstract Customer getCustomer();

	/**
	 * To get to know whether the account is blocked.
	 * 
	 * @return true:blocked,false:unblocked
	 * @description
	 * 
	 * @author <a href="mailto:zexpp5@gmail.com">Zexu.Lin</a>
	 * @update Oct 30, 2011 7:02:25 PM
	 */
	public abstract boolean isBlocked();

	/**
	 * To block current account and set the block state true.
	 * 
	 * @description
	 * 
	 * @author <a href="mailto:zexpp5@gmail.com">Zexu.Lin</a>
	 * @update Oct 30, 2011 7:03:10 PM
	 */
	public abstract void block();

	/**
	 * To get the tarriff of current account by check its account type.
	 * 
	 * @return
	 * @description
	 * 
	 * @author <a href="mailto:zexpp5@gmail.com">Zexu.Lin</a>
	 * @update Oct 30, 2011 7:03:46 PM
	 */
	public abstract int getTariff();
}
